package de.se2.sharebox.frames;

import java.awt.*;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class RegistrationFrame extends JFrame
{
	JLabel jlbUserName = new JLabel("Geben Sie Ihre Benutzername ein: ");
	JTextField jtfUserName = new JTextField();
	JLabel jlbEmailAdresse = new JLabel("Geben Sie Ihre Email ein: ");
	JTextField jtfEmailAdresse = new JTextField();
	JLabel jlbPassword = new JLabel("Geben Sie Ihre Passwort ein: ");
	JPasswordField jpfPassword = new JPasswordField();
	JButton jbRegistration = new JButton("Registrieren");
	JButton jbCancel = new JButton("Cancel");

	public RegistrationFrame()
	{
		this.InitForm();
	}

	private void InitForm()
	{
		setTitle("Registrierung");
		this.setLayout(new GridLayout(4, 0));
		this.add(jlbUserName);
		this.add(jtfUserName);
		this.add(jlbEmailAdresse);
		this.add(jtfEmailAdresse);
		this.add(jlbPassword);
		this.add(jpfPassword);
		this.add(jbRegistration);
		this.add(jbCancel);

		this.setSize(400, 200);
		// this.pack();
		setVisible(true);
	}

	public String getName()
	{
		return this.jtfUserName.getText();
	}

	public String getPassword()
	{
		return this.jpfPassword.getText();
	}

	public String getEmail()
	{
		return this.jtfEmailAdresse.getText();
	}

	public void setName(String name)
	{
		this.jtfUserName.setText(name);
	}

	public void setPassword(String pass)
	{
		this.jpfPassword.setText(pass);
	}

	public void setEmail(String email)
	{
		this.jtfEmailAdresse.setText(email);
	}

	public void setRegistrationListener(ActionListener al)
	{
		this.jbRegistration.addActionListener(al);
	}

	public void setCancelListener(ActionListener al)
	{
		this.jbCancel.addActionListener(al);
	}

}
